package com.ttxs.fileformathandling.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ttxs.fileformathandling.common.ErrorCode;
import com.ttxs.fileformathandling.exception.BusinessException;
import com.ttxs.fileformathandling.model.entity.UserDataStructure;
import com.ttxs.fileformathandling.service.UserDataStructureService;
import com.ttxs.fileformathandling.mapper.UserDataStructureMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * @author cwt
 * @description 针对表【user_data_structure(用户数据结构存储表)】的数据库操作Service实现
 * @createDate 2023-06-13 19:18:18
 */
@Service
public class UserDataStructureServiceImpl extends ServiceImpl<UserDataStructureMapper, UserDataStructure>
        implements UserDataStructureService {

    @Override
    public void validUserDataStructure(UserDataStructure userDataStructure, boolean add) {
        if (userDataStructure == null) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR);
        }
        String structureName = userDataStructure.getStructureName();
        if (StringUtils.isAnyBlank(structureName)){
            throw new BusinessException(ErrorCode.PARAMS_ERROR,"参数不能为空");
        }
    }
}




